package com.leil.movies.common;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

public class DateUtil {

    private static String pattern = "yyyy-MM-dd HH:mm:ss";

    /**
     * 时间戳转换为当前时间
     * @param timestemp     时间戳转换
     * @return              格式化好的时间
     */
    public static String convertDate(long timestemp) {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
        return formatter.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(timestemp), ZoneId.systemDefault()));
    }



}
